.class public Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;
.super Ljava/lang/Object;
.source "ZMDownloadManager.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$CursorTranslator;,
        Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;,
        Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;
    }
.end annotation


# static fields
.field public static final ACTION_DOWNLOAD_COMPLETE:Ljava/lang/String; = "android.intent.action.DOWNLOAD_COMPLETE"

.field public static final ACTION_NOTIFICATION_CLICKED:Ljava/lang/String; = "android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED"

.field public static final ACTION_VIEW_DOWNLOADS:Ljava/lang/String; = "android.intent.action.VIEW_DOWNLOADS"

.field private static final COLUMNS:[Ljava/lang/String;

.field public static final COLUMN_APK_PACKAGE_NAME:Ljava/lang/String; = "apk_package_name"

.field public static final COLUMN_BYTES_DOWNLOADED_SO_FAR:Ljava/lang/String; = "bytes_so_far"

.field public static final COLUMN_DESCRIPTION:Ljava/lang/String; = "description"

.field public static final COLUMN_DOWNLOAD_URL:Ljava/lang/String; = "download_url"

.field public static final COLUMN_ID:Ljava/lang/String; = "_id"

.field public static final COLUMN_IS_NEED_POST_DATA:Ljava/lang/String; = "is_need_post_data"

.field public static final COLUMN_LAST_MODIFIED_TIMESTAMP:Ljava/lang/String; = "last_modified_timestamp"

.field public static final COLUMN_LOCAL_URI:Ljava/lang/String; = "local_uri"

.field public static final COLUMN_MEDIA_TYPE:Ljava/lang/String; = "media_type"

.field public static final COLUMN_OTHER_KEY:Ljava/lang/String; = "other_key"

.field public static final COLUMN_PRIMARY_KEY:Ljava/lang/String; = "primary_key"

.field public static final COLUMN_REASON:Ljava/lang/String; = "reason"

.field public static final COLUMN_STATUS:Ljava/lang/String; = "status"

.field public static final COLUMN_TITLE:Ljava/lang/String; = "title"

.field public static final COLUMN_TOTAL_SIZE_BYTES:Ljava/lang/String; = "total_size"

.field public static final COLUMN_URI:Ljava/lang/String; = "uri"

.field public static final ERROR_CANNOT_RESUME:I = 0x3f0

.field public static final ERROR_DEVICE_NOT_FOUND:I = 0x3ef

.field public static final ERROR_FILE_ALREADY_EXISTS:I = 0x3f1

.field public static final ERROR_FILE_ERROR:I = 0x3e9

.field public static final ERROR_HTTP_DATA_ERROR:I = 0x3ec

.field public static final ERROR_INSUFFICIENT_SPACE:I = 0x3ee

.field public static final ERROR_TOO_MANY_REDIRECTS:I = 0x3ed

.field public static final ERROR_UNHANDLED_HTTP_CODE:I = 0x3ea

.field public static final ERROR_UNKNOWN:I = 0x3e8

.field public static final EXTRA_DOWNLOAD_ID:Ljava/lang/String; = "extra_download_id"

.field private static final LONG_COLUMNS:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field public static final PAUSED_QUEUED_FOR_WIFI:I = 0x3

.field public static final PAUSED_UNKNOWN:I = 0x4

.field public static final PAUSED_WAITING_FOR_NETWORK:I = 0x2

.field public static final PAUSED_WAITING_TO_RETRY:I = 0x1

.field public static final STATUS_FAILED:I = 0x10

.field public static final STATUS_PAUSED:I = 0x4

.field public static final STATUS_PENDING:I = 0x1

.field public static final STATUS_RUNNING:I = 0x2

.field public static final STATUS_SUCCESSFUL:I = 0x8

.field private static final TAG:Ljava/lang/String; = "DownloadManager"

.field private static final UNDERLYING_COLUMNS:[Ljava/lang/String;


# instance fields
.field private mBaseUri:Landroid/net/Uri;

.field private mContext:Landroid/content/Context;

.field private mPackageName:Ljava/lang/String;

.field private mResolver:Landroid/content/ContentResolver;


# direct methods
.method static constructor <clinit>()V
    .registers 8

    .prologue
    const/4 v7, 0x4

    const/4 v6, 0x3

    const/4 v5, 0x2

    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 299
    const/16 v0, 0x10

    new-array v0, v0, [Ljava/lang/String;

    const-string v1, "_id"

    aput-object v1, v0, v3

    const-string v1, "title"

    aput-object v1, v0, v4

    const-string v1, "description"

    aput-object v1, v0, v5

    const-string v1, "uri"

    aput-object v1, v0, v6

    const-string v1, "media_type"

    aput-object v1, v0, v7

    const/4 v1, 0x5

    const-string v2, "total_size"

    aput-object v2, v0, v1

    const/4 v1, 0x6

    const-string v2, "local_uri"

    aput-object v2, v0, v1

    const/4 v1, 0x7

    const-string v2, "status"

    aput-object v2, v0, v1

    const/16 v1, 0x8

    const-string v2, "reason"

    aput-object v2, v0, v1

    const/16 v1, 0x9

    const-string v2, "bytes_so_far"

    aput-object v2, v0, v1

    const/16 v1, 0xa

    const-string v2, "last_modified_timestamp"

    aput-object v2, v0, v1

    const/16 v1, 0xb

    const-string v2, "primary_key"

    aput-object v2, v0, v1

    const/16 v1, 0xc

    const-string v2, "is_need_post_data"

    aput-object v2, v0, v1

    const/16 v1, 0xd

    const-string v2, "apk_package_name"

    aput-object v2, v0, v1

    const/16 v1, 0xe

    const-string v2, "other_key"

    aput-object v2, v0, v1

    const/16 v1, 0xf

    const-string v2, "download_url"

    aput-object v2, v0, v1

    sput-object v0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->COLUMNS:[Ljava/lang/String;

    .line 304
    const/16 v0, 0x11

    new-array v0, v0, [Ljava/lang/String;

    const-string v1, "_id"

    aput-object v1, v0, v3

    const-string v1, "title"

    aput-object v1, v0, v4

    const-string v1, "description"

    aput-object v1, v0, v5

    const-string v1, "uri"

    aput-object v1, v0, v6

    const-string v1, "mimetype"

    aput-object v1, v0, v7

    const/4 v1, 0x5

    const-string v2, "total_bytes"

    aput-object v2, v0, v1

    const/4 v1, 0x6

    const-string v2, "status"

    aput-object v2, v0, v1

    const/4 v1, 0x7

    const-string v2, "current_bytes"

    aput-object v2, v0, v1

    const/16 v1, 0x8

    const-string v2, "lastmod"

    aput-object v2, v0, v1

    const/16 v1, 0x9

    const-string v2, "destination"

    aput-object v2, v0, v1

    const/16 v1, 0xa

    const-string v2, "hint"

    aput-object v2, v0, v1

    const/16 v1, 0xb

    const-string v2, "_data"

    aput-object v2, v0, v1

    const/16 v1, 0xc

    const-string v2, "primary_key"

    aput-object v2, v0, v1

    const/16 v1, 0xd

    const-string v2, "is_need_post_data"

    aput-object v2, v0, v1

    const/16 v1, 0xe

    const-string v2, "apk_package_name"

    aput-object v2, v0, v1

    const/16 v1, 0xf

    const-string v2, "other_key"

    aput-object v2, v0, v1

    const/16 v1, 0x10

    const-string v2, "download_url"

    aput-object v2, v0, v1

    sput-object v0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->UNDERLYING_COLUMNS:[Ljava/lang/String;

    .line 309
    new-instance v0, Ljava/util/HashSet;

    const/4 v1, 0x6

    new-array v1, v1, [Ljava/lang/String;

    const-string v2, "_id"

    aput-object v2, v1, v3

    const-string v2, "total_size"

    aput-object v2, v1, v4

    const-string v2, "status"

    aput-object v2, v1, v5

    const-string v2, "reason"

    aput-object v2, v1, v6

    const-string v2, "bytes_so_far"

    aput-object v2, v1, v7

    const/4 v2, 0x5

    const-string v3, "last_modified_timestamp"

    aput-object v3, v1, v2

    invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V

    sput-object v0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->LONG_COLUMNS:Ljava/util/Set;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/content/ContentResolver;Ljava/lang/String;)V
    .registers 5
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "resolver"    # Landroid/content/ContentResolver;
    .param p3, "packageName"    # Ljava/lang/String;

    .prologue
    .line 807
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 801
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    .line 808
    iput-object p2, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    .line 809
    iput-object p3, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mPackageName:Ljava/lang/String;

    .line 810
    iput-object p1, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mContext:Landroid/content/Context;

    .line 811
    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v0

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    .line 812
    return-void
.end method

.method static synthetic access$100()[Ljava/lang/String;
    .registers 1

    .prologue
    .line 70
    sget-object v0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->COLUMNS:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$200()Ljava/util/Set;
    .registers 1

    .prologue
    .line 70
    sget-object v0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->LONG_COLUMNS:Ljava/util/Set;

    return-object v0
.end method

.method public static getWhereArgsForIds([J)[Ljava/lang/String;
    .registers 5
    .param p0, "ids"    # [J

    .prologue
    .line 1147
    array-length v2, p0

    new-array v1, v2, [Ljava/lang/String;

    .line 1148
    .local v1, "whereArgs":[Ljava/lang/String;
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_4
    array-length v2, p0

    if-ge v0, v2, :cond_12

    .line 1149
    aget-wide v2, p0, v0

    invoke-static {v2, v3}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v0

    .line 1148
    add-int/lit8 v0, v0, 0x1

    goto :goto_4

    .line 1151
    :cond_12
    return-object v1
.end method

.method public static getWhereClauseForIds([J)Ljava/lang/String;
    .registers 4
    .param p0, "ids"    # [J

    .prologue
    .line 1129
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    .line 1130
    .local v1, "whereClause":Ljava/lang/StringBuilder;
    const-string v2, "("

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 1131
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_b
    array-length v2, p0

    if-ge v0, v2, :cond_22

    .line 1132
    if-lez v0, :cond_15

    .line 1133
    const-string v2, "OR "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 1135
    :cond_15
    const-string v2, "_id"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 1136
    const-string v2, " = ? "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 1131
    add-int/lit8 v0, v0, 0x1

    goto :goto_b

    .line 1138
    :cond_22
    const-string v2, ")"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 1139
    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    return-object v2
.end method

.method public static openDownload(Landroid/content/Context;)V
    .registers 3
    .param p0, "mContext"    # Landroid/content/Context;

    .prologue
    .line 994
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/zuimeia/sdk/download/providers/downloads/ui/ZMDownloadListActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 995
    .local v0, "it":Landroid/content/Intent;
    const/high16 v1, 0x10000000

    invoke-virtual {v0, v1}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    .line 996
    invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 997
    return-void
.end method


# virtual methods
.method public enqueue(Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;)J
    .registers 8
    .param p1, "request"    # Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;

    .prologue
    .line 839
    :try_start_0
    iget-object v4, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mPackageName:Ljava/lang/String;

    invoke-virtual {p1, v4}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;->toContentValues(Ljava/lang/String;)Landroid/content/ContentValues;

    move-result-object v1

    .line 840
    .local v1, "values":Landroid/content/ContentValues;
    iget-object v4, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    iget-object v5, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mContext:Landroid/content/Context;

    invoke-static {v5}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v5

    invoke-virtual {v4, v5, v1}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object v0

    .line 841
    .local v0, "downloadUri":Landroid/net/Uri;
    invoke-virtual {v0}, Landroid/net/Uri;->getLastPathSegment()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
    :try_end_19
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_19} :catch_1b

    move-result-wide v2

    .line 847
    .end local v0    # "downloadUri":Landroid/net/Uri;
    .end local v1    # "values":Landroid/content/ContentValues;
    :goto_1a
    return-wide v2

    .line 844
    :catch_1b
    move-exception v4

    .line 847
    const-wide/16 v2, -0x64

    goto :goto_1a
.end method

.method getDownloadUri(J)Landroid/net/Uri;
    .registers 4
    .param p1, "id"    # J

    .prologue
    .line 1122
    iget-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-static {v0, p1, p2}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;

    move-result-object v0

    return-object v0
.end method

.method public handleEnqueue(Landroid/content/Context;Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;)J
    .registers 5
    .param p1, "mContext"    # Landroid/content/Context;
    .param p2, "request"    # Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;

    .prologue
    const/4 v0, 0x0

    .line 851
    invoke-virtual {p0, p1, p2, v0, v0}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->handleEnqueue(Landroid/content/Context;Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadFileExistCallback;Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadingCallback;)J

    move-result-wide v0

    return-wide v0
.end method

.method public handleEnqueue(Landroid/content/Context;Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadFileExistCallback;Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadingCallback;)J
    .registers 13
    .param p1, "mContext"    # Landroid/content/Context;
    .param p2, "request"    # Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;
    .param p3, "fileExistCallback"    # Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadFileExistCallback;
    .param p4, "downloadingCallback"    # Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadingCallback;

    .prologue
    .line 856
    new-instance v2, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;

    invoke-direct {v2}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;-><init>()V

    .line 857
    .local v2, "query":Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;
    new-instance v5, Landroid/os/Handler;

    invoke-direct {v5}, Landroid/os/Handler;-><init>()V

    .line 858
    .local v5, "mHandler":Landroid/os/Handler;
    new-instance v0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$1;

    move-object v1, p0

    move-object v3, p2

    move-object v4, p3

    move-object v6, p1

    move-object v7, p4

    invoke-direct/range {v0 .. v7}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$1;-><init>(Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Request;Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadFileExistCallback;Landroid/os/Handler;Landroid/content/Context;Lcom/zuimeia/sdk/download/providers/downloads/callback/ZMDownloadingCallback;)V

    .line 989
    invoke-virtual {v0}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$1;->start()V

    .line 990
    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public varargs markRowDeleted([J)I
    .registers 7
    .param p1, "ids"    # [J

    .prologue
    .line 1010
    if-eqz p1, :cond_5

    array-length v1, p1

    if-nez v1, :cond_d

    .line 1012
    :cond_5
    new-instance v1, Ljava/lang/IllegalArgumentException;

    const-string v2, "input param \'ids\' can\'t be null"

    invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 1014
    :cond_d
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    .line 1015
    .local v0, "values":Landroid/content/ContentValues;
    const-string v1, "deleted"

    const/4 v2, 0x1

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1016
    iget-object v1, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    iget-object v2, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereClauseForIds([J)Ljava/lang/String;

    move-result-object v3

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereArgsForIds([J)[Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v2, v0, v3, v4}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    move-result v1

    return v1
.end method

.method public openDownloadedFile(J)Landroid/os/ParcelFileDescriptor;
    .registers 6
    .param p1, "id"    # J
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/FileNotFoundException;
        }
    .end annotation

    .prologue
    .line 1062
    iget-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    invoke-virtual {p0, p1, p2}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getDownloadUri(J)Landroid/net/Uri;

    move-result-object v1

    const-string v2, "r"

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->openFileDescriptor(Landroid/net/Uri;Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;

    move-result-object v0

    return-object v0
.end method

.method public varargs pauseDownload([J)V
    .registers 9
    .param p1, "ids"    # [J

    .prologue
    const/4 v5, 0x1

    .line 1074
    new-instance v2, Landroid/content/ContentValues;

    invoke-direct {v2}, Landroid/content/ContentValues;-><init>()V

    .line 1075
    .local v2, "values":Landroid/content/ContentValues;
    const-string v3, "status"

    const/16 v4, 0xc1

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1076
    const-string v3, "control"

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1077
    const-string v3, "no_integrity"

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1078
    iget-object v3, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    iget-object v4, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereClauseForIds([J)Ljava/lang/String;

    move-result-object v5

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereArgsForIds([J)[Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v3, v4, v2, v5, v6}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    .line 1080
    array-length v4, p1

    const/4 v3, 0x0

    :goto_34
    if-ge v3, v4, :cond_42

    aget-wide v0, p1, v3

    .line 1081
    .local v0, "id":J
    invoke-static {}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadHandler;->getInstance()Lcom/zuimeia/sdk/download/providers/downloads/DownloadHandler;

    move-result-object v5

    invoke-virtual {v5, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadHandler;->dequeueWaitDownload(J)V

    .line 1080
    add-int/lit8 v3, v3, 0x1

    goto :goto_34

    .line 1083
    .end local v0    # "id":J
    :cond_42
    return-void
.end method

.method public query(Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;)Landroid/database/Cursor;
    .registers 6
    .param p1, "query"    # Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;

    .prologue
    .line 1047
    iget-object v1, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    sget-object v2, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->UNDERLYING_COLUMNS:[Ljava/lang/String;

    iget-object v3, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-virtual {p1, v1, v2, v3}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$Query;->runQuery(Landroid/content/ContentResolver;[Ljava/lang/String;Landroid/net/Uri;)Landroid/database/Cursor;

    move-result-object v0

    .line 1048
    .local v0, "underlyingCursor":Landroid/database/Cursor;
    if-nez v0, :cond_e

    .line 1049
    const/4 v1, 0x0

    .line 1051
    :goto_d
    return-object v1

    :cond_e
    new-instance v1, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$CursorTranslator;

    iget-object v2, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-direct {v1, v0, v2}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager$CursorTranslator;-><init>(Landroid/database/Cursor;Landroid/net/Uri;)V

    goto :goto_d
.end method

.method public varargs remove([J)I
    .registers 8
    .param p1, "ids"    # [J

    .prologue
    .line 1029
    if-eqz p1, :cond_5

    array-length v2, p1

    if-nez v2, :cond_d

    .line 1031
    :cond_5
    new-instance v2, Ljava/lang/IllegalArgumentException;

    const-string v3, "input param \'ids\' can\'t be null"

    invoke-direct {v2, v3}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v2

    .line 1033
    :cond_d
    array-length v3, p1

    const/4 v2, 0x0

    :goto_f
    if-ge v2, v3, :cond_1d

    aget-wide v0, p1, v2

    .line 1034
    .local v0, "id":J
    invoke-static {}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadHandler;->getInstance()Lcom/zuimeia/sdk/download/providers/downloads/DownloadHandler;

    move-result-object v4

    invoke-virtual {v4, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadHandler;->dequeueWaitDownload(J)V

    .line 1033
    add-int/lit8 v2, v2, 0x1

    goto :goto_f

    .line 1036
    .end local v0    # "id":J
    :cond_1d
    iget-object v2, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    iget-object v3, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereClauseForIds([J)Ljava/lang/String;

    move-result-object v4

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereArgsForIds([J)[Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v3, v4, v5}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I

    move-result v2

    return v2
.end method

.method public varargs restartDownload([J)V
    .registers 7
    .param p1, "ids"    # [J

    .prologue
    .line 1110
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    .line 1111
    .local v0, "values":Landroid/content/ContentValues;
    const-string v1, "current_bytes"

    const/4 v2, 0x0

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1112
    const-string v1, "total_bytes"

    const/4 v2, -0x1

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1113
    const-string v1, "_data"

    invoke-virtual {v0, v1}, Landroid/content/ContentValues;->putNull(Ljava/lang/String;)V

    .line 1114
    const-string v1, "status"

    const/16 v2, 0xbe

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1115
    iget-object v1, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    iget-object v2, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereClauseForIds([J)Ljava/lang/String;

    move-result-object v3

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereArgsForIds([J)[Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v2, v0, v3, v4}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    .line 1116
    return-void
.end method

.method public varargs resumeDownload([J)V
    .registers 7
    .param p1, "ids"    # [J

    .prologue
    .line 1094
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    .line 1095
    .local v0, "values":Landroid/content/ContentValues;
    const-string v1, "status"

    const/16 v2, 0xbe

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1096
    const-string v1, "control"

    const/4 v2, 0x0

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1097
    iget-object v1, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mResolver:Landroid/content/ContentResolver;

    iget-object v2, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereClauseForIds([J)Ljava/lang/String;

    move-result-object v3

    invoke-static {p1}, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->getWhereArgsForIds([J)[Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v2, v0, v3, v4}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    .line 1098
    return-void
.end method

.method public setAccessAllDownloads(Z)V
    .registers 3
    .param p1, "accessAllDownloads"    # Z

    .prologue
    .line 822
    if-eqz p1, :cond_b

    .line 823
    iget-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAllDownloadsContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v0

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    .line 827
    :goto_a
    return-void

    .line 825
    :cond_b
    iget-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v0

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/ZMDownloadManager;->mBaseUri:Landroid/net/Uri;

    goto :goto_a
.end method
